package cloud.server1.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cloud.server1.service.KilimService;
import cloud.server1.service.task.TaskA;
import cloud.server1.service.task.TaskB;
import cloud.server1.service.task.TaskC;
import cloud.server1.service.task.TaskD;
import kilim.Scheduler;

@Service
public class KilimServiceImpl implements KilimService{
	@Autowired
    private TaskC taskA;
	@Autowired
    private TaskD taskB;
	/**
	 * 测试任务轮流占用线程执行
	 * @return
	 */
	public String recycle(){
		System.out.println("当前工作线程数为："+Scheduler.defaultNumberThreads);
		Scheduler.defaultNumberThreads=1;
		System.out.println("修改工作线程数为："+Scheduler.defaultNumberThreads);
		taskA.start();
		taskB.start();
		return null;
	}
}
